/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ADT;

import Interfaces.BoundingBox;
import Interfaces.Mass;
import Interfaces.Pallet;
import Interfaces.StowageLocation;

/**
 *
 * @author markusbaisch
 */
public class NullPalletImpl extends BodyImpl implements Pallet {

    StowageLocation loc;

    // Konstruktor
    private NullPalletImpl(BoundingBox box) {
        this.boundingBox = box;
    }

    static Pallet valueOf(BoundingBox box) {
        return new NullPalletImpl(box);
    }

    @Override
    public Mass mass() {
        return Entities.MASS_ZERO;
    }

    @Override
    public BoundingBox boundingBox() {
        return boundingBox;
    }

    @Override
    public StowageLocation loc() {
        return loc;
    }

    @Override
    public void setLocNull() {
        loc = Entities.nullLocation();
    }

    @Override
    public void setLoc(Object stowage, StowageLocation loc) {
        this.loc = loc;
    }

    @Override
    public boolean isFree() {
        return true;
    }

    @Override
    public boolean isBlocked() {
        return false;
    }

    @Override
    public boolean isOccupied() {
        return false;
    }

    @Override
    public int compareTo(Pallet t) {
        return Double.compare( mass.kg(), t.mass().kg() );
    }
}
